<script>
function getby_code(code){
	var name= $('#product_name').val()
	var category = $('#product_category').val()
	var company = $('#company_name').val()
	
$.post("<?= site_url('sales/search/getby_code')?>",{ code : code, name:name, category: category, company : company }, function(msg){
							if(msg){
								$("#report").show();
								$("#report").html(msg);
								
							}
		
						})
	
}
function getby_name(name){
	var code= $('#product_code').val()
	var category = $('#product_category').val()
	var company = $('#company_name').val()

$.post("<?= site_url('sales/search/getby_name')?>",{ name : name, code : code, category: category ,company : company }, function(msg){
							if(msg){
									$("#report").show();
								$("#report").html(msg);
								
						}
		
						})
	
}

function getby_category(category){
		var code= $('#product_code').val()
	var name = $('#product_name').val()
	var company = $('#company_name').val()

$.post("<?= site_url('sales/search/getby_category')?>",{ category : category, code : code, name:name, company : company}, function(msg){
							if(msg){
									$("#report").show();
								$("#report").html(msg);
								
						}
		
						})
	
}


function getby_company(company){
	//alert(company)
	var code= $('#product_code').val()
	var name = $('#product_name').val()
	var category = $('#product_category').val()
	
$.post("<?= site_url('sales/search/getby_company')?>",{ company:company, category : category, code : code, name:name}, function(msg){
							if(msg){
								//alert(msg)
									$("#report").show();
								$("#report").html(msg);
								
						}
		
						})
	
}



</script>

<h2 style="background-color:#368EE0; color:white; font-size:20px; padding:5px;">Search Item </h2>
<br>
<br>
<div class="row-fluid">

<div class="span12">
<table width="100%" >
<tr>
<td><b>Item Code: </b></td>
<td>&nbsp;</td>
<td><b>Item Name: </b></td>
<td>&nbsp;</td>
<td><b>Item Category:</b></td>
<td>&nbsp;</td>
<td><b>Item Company:</b></td>

</tr>
<tr> 
<td><input type="text" onkeyup="getby_code(this.value)"  id="product_code"></td>
<td><b>OR</b></td>
<td><input type="text" onkeyup="getby_name(this.value)"  id="product_name"></td>
<td><b>OR</b></td>
<td><input type="text" onkeyup="getby_category(this.value)"  id="product_category"></td>
<td><b>OR</b></td>
<td><input type="text" onkeyup="getby_company(this.value)"  id="company_name"></td>
</tr>

	</table>
	</div>

</div>	
<div class="line"></div>
<div class="row-fluid">
<div class="span12" id="report" style="display: none">
lkhkjthkjtrhekj
</div>	
	